<template>
	<div>
		<div class="searchForm">
		    <div class="flex">
		        用户手机号： 
				<selectUser @callEnter="search" ref="selectUser" @getUserId="getUserId"  />
			</div>
			
			<div class="flex">
			    下单日期： 
				<el-date-picker
				      v-model="time"
					  size="mini"
					  value-format="yyyy-MM-dd"
				      type="daterange"
				      range-separator="至"
				      start-placeholder="开始日期"
				      end-placeholder="结束日期">
				</el-date-picker>
			</div>
			<div>
			    <el-button type="primary" size="mini" @click="search">检索</el-button>
			    <el-button size="mini" @click="clearSearch">重置/检索</el-button>
			</div>
		</div>
		<br>
		<el-table  :data="list"
			 border  
			 style="width: 100%"
			>
			<el-table-column   align="center" width="150"   prop="order_sn"    label="订单编号"></el-table-column>
			<el-table-column  label="是否变现"   align="center">
			     <template slot-scope="scope">
			        <div>
						<el-tag v-if="scope.row.is_bx==0" size="small" effect="dark" type="danger">否</el-tag>
						<el-tag v-if="scope.row.is_bx==1" size="small" effect="dark">是</el-tag>
					</div>
			     </template>
			 </el-table-column>
			<el-table-column   align="center" width="150"   prop="supplier"  label="供应商"></el-table-column>
			<el-table-column   align="center" width="150"   prop="add_time"  label="制单日期"></el-table-column>
			<el-table-column   align="center"    prop="pay_time"    label="结算日期"></el-table-column>
			<el-table-column   align="center"    prop="show_goods_name"    label="商品名称"></el-table-column>
			<el-table-column   align="center"    prop="show_weight"    label="实收重量"></el-table-column>
			<el-table-column   align="center"    prop="pay_money"    label="实际结算金额"></el-table-column>
			<el-table-column  label="类型" align="center">
				<template slot-scope="scope">
				   <div>
						{{['','行情卖料','灵活寄存','定价卖料'][scope.row.ttype]}}
					</div>
				</template>
			</el-table-column>
			<el-table-column   align="center" width="130"   prop="pay_money"    label="实际结算金额"></el-table-column>
			<el-table-column   align="center"  width="150"  prop="pay_time"    label="结算时间"></el-table-column>
			<el-table-column   align="center"  width="150"  prop="delivery_number"    label="物流单号"></el-table-column>
			<el-table-column   align="center"  width="150"  prop="remark"  label="备注"></el-table-column>
			
		</el-table>
		<div class="page">
		    <el-pagination
		            background
		            @size-change="pageChange"
		            @current-change="handleCurrentChange"
		            :current-page="page"
		            :page-size="pageSize"
		            layout="total, sizes, prev, pager, next, jumper"
		            :total="page_totle">
		    </el-pagination>
		</div>
	</div>
</template>

<script>
	import selectUser from '@/components/selectUser'
	export default {
		components:{
			selectUser
		},
		data(){
			return {
				page:1,
				pageSize:10,
				page_totle:0,
				search_form:{
					mid:'',
					start_time:'',
					end_time:'',
					ttype:[2]
				},
				time:[],
			}
		},
		mounted() {
			this.lodeList()
		},
		methods:{
			clearSearch(){
				this.search_form = {
					mid:'',
					start_time:'',
					end_time:'',
					ttype:[2]
				}
				this.time= []
				this.page = 1
				this.search()
			},
			getUserId(val){
				this.page = 1
				this.search_form.mid = val
				this.search()
			},
			lodeList(){
				let params = {
					page:this.page,
					pageSize:this.pageSize,
					search_form:this.search_form,
				}
				this.$post('/buyerSys/getBuyerSys',params,res=>{
					let result = res.data
					this.list = result.data.result
					this.page_totle = result.data.count
				})
			},
		}
	}
</script>

<style>
</style>